﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HCQ2_Model
{
    /// <summary>
    ///  用户等级模型
    /// </summary>
    public class UserLevelModel
    {
        public int id { get; set; }
        public int user_level { get; set; }
        public decimal min_sale { get; set; }
        public decimal max_sale { get; set; }
        public int min_line { get; set; }
        public int max_line { get; set; }
        public int create_id { get; set; }
        public string create_name { get; set; }
        public string create_date { get; set; }
        public int update_id { get; set; }
        public string update_name { get; set; }
        public string update_date { get; set; }
        public string level_note { get; set; }
        public decimal price_rate { get; set; }
        public T_VRUserLevel ToEntry()
        {
            return new T_VRUserLevel
            {
                id = id,
                user_level = user_level,
                min_sale = min_sale,
                max_sale = max_sale,
                min_line = min_line,
                max_line = max_line,
                create_id = create_id,
                create_name = create_name,
                create_date = DateTime.Now,
                update_id = update_id,
                update_name = update_name,
                update_date = DateTime.Now,
                level_note = level_note,
                price_rate = price_rate
            };
        }
    }
    public partial class T_VRUserLevel
    {
        public UserLevelModel ToPOCO()
        {
            return new UserLevelModel
            {
                id = id,
                user_level = user_level,
                min_sale = min_sale,
                max_sale = max_sale,
                min_line = min_line,
                max_line = max_line,
                create_id = create_id,
                create_name = create_name,
                create_date = create_date.ToString("yyyy-MM-dd HH:mm"),
                update_id = update_id,
                update_name = update_name,
                update_date = update_date.ToString("yyyy-MM-dd HH:mm"),
                level_note = level_note,
                price_rate = price_rate
            };
        }
    }
}